package com.liuer.mapper;

import com.liuer.dto.UserDTO;
import com.liuer.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface LoginMapper {
    /**
     * 进行登录校验
     * @param u
     * @return
     */
    @Select("select * from users where password = #{password} and username = #{username};")
    User getUser(UserDTO u);

    /**
     * 根据用户名查询用户是否存在
     * @param username
     * @return
     */
    @Select("select * from users where username = #{username}")
    String getUserByUsername(String username);

}
